package com.koyi0000.mq.rabbit.test;

import com.koyi0000.mq.constant.RmConst;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author koyi0000
 * Description  Date 2020/9/12 7:28
 **/
@Component
public class DefaultSender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    private void send(String msg) {
        String sendMsg = msg + "====" +System.currentTimeMillis();
        System.out.println("Sender" + sendMsg);
        this.rabbitTemplate.convertAndSend(RmConst.QUEUE_HELLO, sendMsg);
        this.rabbitTemplate.convertAndSend(RmConst.QUEUE_USER, sendMsg);

//        ConcurrentHashMap
//        HashMap

    }
}
